feat: publish global → proj_frame FrameTransform from proj_frame_offset#200
feat: publish global → proj_frame FrameTransform from proj_frame_offset#200jdsika wants to merge 2 commits into
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughAdds proj_frame support: a new Changesproj_frame_offset Frame Transform Support
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
tests/frameTransformConverter.spec.ts (1)
202-204: ⚡ Quick winAvoid order-coupled assertions for the proj transform.
Using
result.transforms[2]makes these tests brittle. Prefer locating the transform byparent_frame_id === "proj_frame"andchild_frame_id === "global".[details]
[/details]Proposed test hardening
- const projTransform = result.transforms[2]!; + const projTransform = result.transforms.find( + (t) => t.parent_frame_id === "proj_frame" && t.child_frame_id === "global", + )!;Also applies to: 240-241
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/frameTransformConverter.spec.ts` around lines 202 - 204, The assertions are brittle because they rely on a fixed index into result.transforms; instead, find the transform object by searching result.transforms for an entry where parent_frame_id === "proj_frame" && child_frame_id === "global" (e.g., assign projTransform = result.transforms.find(t => ...)) and assert its properties; do the same replacement for the other occurrence that currently uses result.transforms[?] (the assertions around the second proj transform) so tests are order-independent.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/config/frameTransformNames.ts`:
- Around line 10-12: The comment in src/config/frameTransformNames.ts
incorrectly documents the transform direction; update the comment that currently
reads `"global" → "proj_frame"` to reflect the actual emitted FrameTransform
with parent="proj_frame" and child="global" (i.e., "proj_frame" → "global"), and
mention GroundTruth.proj_frame_offset and the FrameTransform emission so readers
understand the correct parent/child frame IDs.
In `@src/converters/groundTruth/frameTransformConverter.ts`:
- Around line 183-187: The docblock in
src/converters/groundTruth/frameTransformConverter.ts incorrectly instructs that
parent="proj_frame", child="global" uses an "INVERTED offset", which contradicts
the implementation that publishes offset/yaw as-is; update the comment to remove
the “INVERTED offset” guidance and clearly state the single correct convention
(either parent="proj_frame", child="global" with offset published as-is, or
equivalently parent="global", child="proj_frame" with the unchanged offset) so
the prose matches the actual behavior in the frameTransformConverter logic.
---
Nitpick comments:
In `@tests/frameTransformConverter.spec.ts`:
- Around line 202-204: The assertions are brittle because they rely on a fixed
index into result.transforms; instead, find the transform object by searching
result.transforms for an entry where parent_frame_id === "proj_frame" &&
child_frame_id === "global" (e.g., assign projTransform =
result.transforms.find(t => ...)) and assert its properties; do the same
replacement for the other occurrence that currently uses result.transforms[?]
(the assertions around the second proj transform) so tests are
order-independent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: a252e407-3560-4908-9ce7-c351310e906f
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (4)
package.jsonsrc/config/frameTransformNames.tssrc/converters/groundTruth/frameTransformConverter.tstests/frameTransformConverter.spec.ts
6bcf674 to
bf2d1cc
Compare
Add proj_frame support to the OSI GroundTruth FrameTransform converter. When GroundTruth.proj_frame_offset is present, a FrameTransform is emitted with parent=global, child=proj_frame (inverted offset). This keeps 'global' as the frame tree root and enables Lichtblick to resolve OpenDRIVE map geometry (in frame_id='proj_frame') alongside OSI moving objects (in frame_id='global') through a shared tree: global (root) ├── ego_vehicle_bb_center → ego_vehicle_rear_axle └── proj_frame (CRS world) The inversion uses existing math helpers (invertQuaternion, pointRotationByQuaternion) from @utils/math. Also regenerates yarn.lock to resolve from public registry (registry.yarnpkg.com) instead of internal BMW Artifactory. Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
Ensure agent instructions remind contributors to check for documentation drift when implementing features. Signed-off-by: Carlo van Driesten <carlo.van-driesten@bmw.de>
bf2d1cc to
22eb3dd
Compare
Summary
When
GroundTruth.proj_frame_offsetis present, publish an additional FrameTransform connecting the OSI"global"frame to the geographic CRS world frame"proj_frame".This keeps
"global"as the frame tree root (consistent with existing ego transforms) and enables Lichtblick to resolve OpenDRIVE map geometry (in"proj_frame") alongside OSI objects (in"global") through a shared tree.Changes
parent="global", child="proj_frame"with invertedproj_frame_offset(usinginvertQuaternion+pointRotationByQuaternionfrom@utils/math)OSI_PROJ_FRAME = "proj_frame"inframeTransformNames.tswith documentationproj4+@types/proj4for future CRS normalizationproj_frame_offset, zero yaw, and inverted offset mathregistry.yarnpkg.com(was pointing to internal BMW Artifactory)Architecture: Shared
"proj_frame"ConventionBoth plugins independently publish to/from a shared frame called
"proj_frame":FrameTransform(parent="global", child="proj_frame")— inverted offset placesproj_frameas child ofglobalframe_id="proj_frame"Frame tree (when
proj_frame_offsetis present):Why invert the offset?
GroundTruth.proj_frame_offsetdefines whereglobal's origin sits inproj_framecoordinates. Since we publishparent="global", child="proj_frame", we need the inverse: whereproj_frame's origin sits inglobal. The inversion uses existing helpers from@utils/math.Related
Summary by CodeRabbit
New Features
Dependencies
Tests
Documentation